#include("_user_detail_layout.html")
#@user_detail_layout("detail-member")

#define layout_script()
<script>
    function del(id) {
        if (confirm("确定要删除该会员吗？")){
           ajaxGet("#(CPATH)/admin/user/doMemberDel?id="+id)
        }
    }
</script>
#end

#define detail()

<div class="card-header with-border">
    <div class="row admin-search-panel">
        <div class="col-12">
            <a href="javascript:;" class="btn btn-primary"
               open-type="layer"
               data-layer-content="#(CPATH)/admin/user/memberedit?userId=#(user.id)"
               data-layer-title="添加会员"
               data-layer-area="['60%', '80%']"
               data-layer-end="reload"
            >
                <i class="fas fa-plus"></i> 添加会员
            </a>
            <button type="submit" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
        </div>
    </div>
</div>


<div class="card-body p-0">
    <table class="table table-striped">
        <tbody>
        <tr>
            <th style="width: 25%">会员名称</th>
            <th style="">到期时间</th>
            <th style="">创建时间</th>
            <th style="width: 10%">来源</th>
            <th style="width: 15%">操作</th>
        </tr>

        #for(member : members ??)
        <tr>
            <td>#(member.group.name ??)</td>
            <td>#date(member.duetime ??)</td>
            <td>#date(member.created ??)</td>
            <td>#(member.sourceStr)</td>
            <td>
                <a href="javascript:;"
                   open-type="layer"
                   data-layer-content="#(CPATH)/admin/user/memberedit?userId=#(user.id)&id=#(member.id)"
                   data-layer-title="添加会员"
                   data-layer-area="['60%', '80%']"
                   data-layer-end="reload">编辑</a>

                <a href="javascript:;"
                   open-type="layer"
                   data-layer-content="#(CPATH)/admin/user/memberRenewal?id=#(member.id)"
                   data-layer-title="添加会员"
                   data-layer-area="['60%', '80%']"
                   data-layer-end="reload">续期</a>

                <a href="javascript:;" onclick="del('#(member.id)')">删除</a>
            </td>
        </tr>
        #end


        </tbody>
    </table>
</div>

<div class="card-footer">
    <div class="row">
        <div class="col-sm-12">

        </div>
    </div>
</div>

#end

